#ifndef _shared_h_
#define _shared_h_

// Objects common to all of alendar's projects

// Tool to stringify the "value" of a macro instead of the name of that macro
// http://gcc.gnu.org/onlinedocs/cpp/Stringification.html
// ex: printf("FOO=%s\n", QUOTEME(FOO));
// becomes: printf("FOO=%s\n", "bar");

#define QUOTEME_(x) #x
#define QUOTEME(x) QUOTEME_(x)

// Example of macro concatentation
//     #define COMMAND(NAME)  { #NAME, NAME ## _command }
// Support some limited pre conditions; writes to C:\MyApps\jammit\MSC10.Debug.Debug_full.Gui.Mt\jammit.log
#include <assert.h>

// Define constants that are easily typoed
// What are the most common mistakes?  Zeros and Ones.  So I just put er down as strings
// Initially used in my timer code

#define ONEHUNDRED             100
#define THOUSAND              1000
#define TENTHOUSAND          10000
#define HUNDREDTHOUSAND     100000
#define MILLION            1000000
#define BILLION         1000000000

#define BOOL_CHECKED true
#define BOOL_NOTCHECKED false

// Used in MainWin.h to add ToolButtons to a ToolBar without so much typing
// 1) Name of object and its handler
// 2) tip message for hover
// 3) Defaults to checked?

#define ADDTOOL(bar, o, tip, ck) \
		(o).WhenAction = THISBACK(o##Click); \
		(o).Tip((tip)).Image(MyImages::o()).Check((ck)); \
		bar.Add((o));

// Wrappers to help reduce risk of using dynamic memory

#define DELETE_OB(o) delete o; o = NULL;
#define NEW_OB(o) assert(o == NULL); o = new 

// Just some uom labels to put after a constant to document what unit of measure this value is supposed to be
#define UOM_ms 
//#define UOM_µs  // Causes error in build in linux gcc compilation.

// Common markers
// HACK:
// BUG:
// TODO:
// SLOW:
// PROJECT_SPECIFIC: Keyword is specific to this project
// CONCERN: Duurrrrr, duhhh
// CRITICAL: Do not remove this section because it took forever to figure out.

#define CAT String().Cat()

#endif
